import socket
import struct


ip_port = ('127.0.0.1',9998)
#创建一个 socket 传输类型为流
with socket.socket(socket.AF_INET,socket.SOCK_STREAM) as s:
    s.bind(ip_port)
    s.listen(1)
    conn, addr = s.accept()
    with conn:
        print('Connected by', addr)
        while True:
            print('while True')
            data = conn.recv(1024)
            print(data);
            if not data: break
            conn.sendall(data)



